tools/libxl: fix "xl console" for primary console
authorIan Campbell <ian.campbell@citrix.com>
Wed, 18 Aug 2010 16:09:59 +0000 (17:09 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 18 Aug 2010 16:09:59 +0000 (17:09 +0100)
commitdaefca342654607db724ce79e212d29d029d662d
treec487c5f03b5243b31e19a2bbe487fd5889bf4ac6
parent7faaa30132c201c228fafada4bb066efe51e6517
tools/libxl: fix "xl console" for primary console

libxl_console_constype is an enum and can therefore be unsigned so
using -1 as a sentinel for unset in main_console fails to work as
expected.

Arrange for all valid enum values to be > 0 and use 0 as the sentinal
instead.

If the user does not request a specific type then always use the
primary console since using "-n" but not "-t" is not meaningful as we
do not know which type to request.

Also make libxl_console_exec reject invalid values of type.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/xl_cmdimpl.c